package com.sinosoft.ebusiness.domain.elementManage;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;

@Embeddable
public class GeProductKindCalcuteId implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4472536351978955121L;
	/**
	 * 
	 */
	private String productCode;
	private String version;
	private String kindCode;
	

	@Column(name = "PRODUCTCODE")
	public String getProductCode() {
		return productCode;
	}
	public void setProductCode(String productCode) {
		this.productCode = productCode;
	}
	@Column(name = "VERSION")
	public String getVersion() {
		return version;
	}
	public void setVersion(String version) {
		this.version = version;
	}
	@Column(name = "KINDCODE")
	public String getKindCode() {
		return kindCode;
	}
	public void setKindCode(String kindCode) {
		this.kindCode = kindCode;
	}
	
	public boolean equals(Object other) {
		if ((this == other)) {
			return true;
		}
		if ((other == null)) {
			return false;
		}
		if (!(other instanceof GeProductKindCalcuteId)) {
			return false;
		}
		GeProductKindCalcuteId castOther = (GeProductKindCalcuteId) other;

		return ((this.getProductCode() == castOther.getProductCode()) || (this
				.getProductCode() != null && castOther.getProductCode() != null && this
				.getProductCode().equals(castOther.getProductCode())))
				&& ((this.getVersion() == castOther.getVersion()) || (this
						.getVersion() != null
						&& castOther.getVersion() != null && this
						.getVersion().equals(castOther.getVersion())))
				&& ((this.getKindCode() == castOther.getKindCode()) || (this
						.getKindCode() != null && castOther.getKindCode() != null && this
						.getKindCode().equals(castOther.getKindCode())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getProductCode() == null ? 0 : this.getProductCode().hashCode());
		result = 37
				* result
				+ (getVersion() == null ? 0 : this.getVersion()
						.hashCode());
		result = 37
				* result
				+ (getKindCode() == null ? 0 : this.getKindCode()
						.hashCode());
		return result;
	}
	
}
